﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true"
    CodeBehind="Giohang.aspx.cs" Inherits="TPCN.Giohang" %>

<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
    <script src="Scripts/library.js" type="text/javascript"></script>
    <link href="App_Themes/Default/gridview-shoppingcart.css" rel="stylesheet" type="text/css" />
    <link href="App_Themes/Admincp/forms.css" rel="stylesheet" type="text/css" />
    <link href="App_Themes/Admincp/messages.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="content" ContentPlaceHolderID="content" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div class="box">
        <div class="boxtitle">
            Giỏ hàng của bạn
        </div>
        <div class="boxcontent padding20">
            <asp:Panel ID="mainpanel" runat="server">
                <div class="cart-sum message info">
                    Tổng tiền : 
                    <span><asp:Literal ID="lblTongtien" runat="server"></asp:Literal></span>
                    <sup>đ</sup>
                </div>
                <div class="cart-grid">
                    <asp:GridView ID="gridCart" runat="server" AllowPaging="True" AllowSorting="True"
                        AutoGenerateColumns="False" Width="100%" DataKeyNames="HangID" 
                        OnRowCommand="gridCart_RowCommand" CssClass="gridview" 
                        AlternatingRowStyle-CssClass="even" BorderStyle="None">
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:CheckBox ID="chkSelectall" runat="server" CssClass="chkHeader" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkSelect" runat="server" CssClass="chkItem" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="HangID" HeaderText="Mã sản phẩm">
                                <HeaderStyle CssClass="hide" />
                                <ItemStyle HorizontalAlign="Center" CssClass="hide" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Tenhang" HeaderText="Tên sản phẩm" />
                            <asp:BoundField DataField="Dongia" DataFormatString="{0:N0}" HeaderText="Đơn giá" />
                            <asp:TemplateField HeaderText="Số lượng">
                                <ItemTemplate>
                                    <telerik:RadNumericTextBox ID="txtSoluong" runat="server" Culture="vi-VN" DataType="System.Int32"
                                        EnableEmbeddedSkins="False" EnableTheming="False" MaxValue="60000" MinValue="0"
                                        Value='<%# Convert.ToInt32(Eval("Soluong")) %>' Width="50px">
                                        <NumberFormat DecimalDigits="0" DecimalSeparator="." GroupSeparator="," />
                                    </telerik:RadNumericTextBox>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="Thanhtien" DataFormatString="{0:N0}" HeaderText="Thành tiền" />
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnDelete" runat="server" CommandArgument='<%# Eval("HangID") %>'
                                        CommandName="cmdDelete" OnClientClick="return confirm('Bạn có muốn xóa sản phẩm này khỏi giỏ hàng không?');">Xóa</asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
                <div class="cart-button">
                    <asp:Button ID="btnHome" runat="server" Text="Quay lại trang chủ" CausesValidation="False"
                        OnClick="btnHome_Click" UseSubmitBehavior="False" CssClass="button button-green" />
                    <asp:Button ID="btnDelete" runat="server" Text="Xóa" OnClientClick="return confirm('Bạn có muốn xóa các sản phẩm đã chọn không?');"
                        OnClick="btnDelete_Click"  CssClass="button button-green" />
                    <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Cập nhật"  CssClass="button button-green" />
                    <span><asp:Button ID="btnDathang" runat="server" Text="Đặt hàng"  
                        CssClass="button button-green" onclick="btnDathang_Click" /></span>
                    <div class="clear"></div>
                </div>
            </asp:Panel>
        </div>
    </div>
</asp:Content>
